package com.path.planning.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.locationtech.jts.geom.Geometry;

import java.util.Date;

/**
 * 路网数据实体
 * 统一的路网表结构，支持多国家数据
 */
@ApiModel(description = "路网数据实体")
@TableName("routing_network")
public class RoutingNetwork {

    @ApiModelProperty(value = "主键ID")
    @TableId(type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "道路名称")
    private String name;

    @ApiModelProperty(value = "道路几何信息（线几何）", required = true)
    private Geometry geom;

    @ApiModelProperty(value = "道路长度（米）")
    private Double length;

    @ApiModelProperty(value = "起点节点ID")
    private Long source;

    @ApiModelProperty(value = "终点节点ID")
    private Long target;

    @ApiModelProperty(value = "起点坐标")
    private Geometry sourcePoint;

    @ApiModelProperty(value = "终点坐标")
    private Geometry targetPoint;

    @ApiModelProperty(value = "创建时间")
    private Date createdAt;

    @ApiModelProperty(value = "更新时间")
    private Date updatedAt;

    // 构造函数
    public RoutingNetwork() {}

    public RoutingNetwork(String name, Geometry geom) {
        this.name = name;
        this.geom = geom;
    }

    // Getter和Setter方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Geometry getGeom() {
        return geom;
    }

    public void setGeom(Geometry geom) {
        this.geom = geom;
    }

    public Double getLength() {
        return length;
    }

    public void setLength(Double length) {
        this.length = length;
    }

    public Long getSource() {
        return source;
    }

    public void setSource(Long source) {
        this.source = source;
    }

    public Long getTarget() {
        return target;
    }

    public void setTarget(Long target) {
        this.target = target;
    }

    public Geometry getSourcePoint() {
        return sourcePoint;
    }

    public void setSourcePoint(Geometry sourcePoint) {
        this.sourcePoint = sourcePoint;
    }

    public Geometry getTargetPoint() {
        return targetPoint;
    }

    public void setTargetPoint(Geometry targetPoint) {
        this.targetPoint = targetPoint;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public String toString() {
        return "RoutingNetwork{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", length=" + length +
                ", source=" + source +
                ", target=" + target +
                '}';
    }
}
